<?php


namespace app\queue\stomp;


use app\queue\BaseConsumer;
use common\service\TaskAssembleService;

/**
 * 任务下游就绪检查
 */
class TaskDownstreamAssembleCheckConsumer extends BaseConsumer
{
    // 要消费的队列名
    public $queue = 'task_downstream_assemble_check';

    // 连接名，对应 config/redis_queue.php 里的连接`
    public $connection = 'default';

    /**
     * 消费
     * @param $data
     * @return void
     * @throws \Throwable
     */
    public function doConsume($data)
    {
        try {
            TaskAssembleService::getInstance()->checkDownstreamWaitAssembleStatus($data['task_id']);
        } catch (\Throwable $e) {
            trace(format_exception_info($e), 'ERR');
        }
    }
}
